3.396 \(\int \sec ^2(c+d x) (a+b \sin (c+d x))^2 \, dx\)

Optimal. Leaf size=49 \[ \frac{a b \cos (c+d x)}{d}+\frac{\sec (c+d x) (a \sin (c+d x)+b) (a+b \sin (c+d x))}{d}+b^2 (-x) \]

[Out]

-(b^2*x) + (a*b*Cos[c + d*x])/d + (Sec[c + d*x]*(b + a*Sin[c + d*x])*(a + b*Sin[c + d*x]))/d

________________________________________________________________________________________

Rubi [A]  time = 0.0484278, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {2691, 2638} \[ \frac{a b \cos (c+d x)}{d}+\frac{\sec (c+d x) (a \sin (c+d x)+b) (a+b \sin (c+d x))}{d}+b^2 (-x) \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^2*(a + b*Sin[c + d*x])^2,x]

[Out]

-(b^2*x) + (a*b*Cos[c + d*x])/d + (Sec[c + d*x]*(b + a*Sin[c + d*x])*(a + b*Sin[c + d*x]))/d

Rule 2691

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> -Simp[((g*C
os[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^(m - 1)*(b + a*Sin[e + f*x]))/(f*g*(p + 1)), x] + Dist[1/(g^2*(p + 1
)), Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x])^(m - 2)*(b^2*(m - 1) + a^2*(p + 2) + a*b*(m + p + 1)*Sin
[e + f*x]), x], x] /; FreeQ[{a, b, e, f, g}, x] && NeQ[a^2 - b^2, 0] && GtQ[m, 1] && LtQ[p, -1] && (IntegersQ[
2*m, 2*p] || IntegerQ[m])

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \sec ^2(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac{\sec (c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{d}-\int \left (b^2+a b \sin (c+d x)\right ) \, dx\\ &=-b^2 x+\frac{\sec (c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{d}-(a b) \int \sin (c+d x) \, dx\\ &=-b^2 x+\frac{a b \cos (c+d x)}{d}+\frac{\sec (c+d x) (b+a \sin (c+d x)) (a+b \sin (c+d x))}{d}\\ \end{align*}

Mathematica [A]  time = 0.0586616, size = 55, normalized size = 1.12 \[ \frac{a^2 \tan (c+d x)}{d}+\frac{2 a b \sec (c+d x)}{d}-\frac{b^2 \tan ^{-1}(\tan (c+d x))}{d}+\frac{b^2 \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^2*(a + b*Sin[c + d*x])^2,x]

[Out]

-((b^2*ArcTan[Tan[c + d*x]])/d) + (2*a*b*Sec[c + d*x])/d + (a^2*Tan[c + d*x])/d + (b^2*Tan[c + d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.036, size = 46, normalized size = 0.9 \begin{align*}{\frac{1}{d} \left ({a}^{2}\tan \left ( dx+c \right ) +2\,{\frac{ab}{\cos \left ( dx+c \right ) }}+{b}^{2} \left ( \tan \left ( dx+c \right ) -dx-c \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^2*(a+b*sin(d*x+c))^2,x)

[Out]

1/d*(a^2*tan(d*x+c)+2*a*b/cos(d*x+c)+b^2*(tan(d*x+c)-d*x-c))

________________________________________________________________________________________

Maxima [A]  time = 1.46466, size = 62, normalized size = 1.27 \begin{align*} -\frac{{\left (d x + c - \tan \left (d x + c\right )\right )} b^{2} - a^{2} \tan \left (d x + c\right ) - \frac{2 \, a b}{\cos \left (d x + c\right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-((d*x + c - tan(d*x + c))*b^2 - a^2*tan(d*x + c) - 2*a*b/cos(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 2.09162, size = 104, normalized size = 2.12 \begin{align*} -\frac{b^{2} d x \cos \left (d x + c\right ) - 2 \, a b -{\left (a^{2} + b^{2}\right )} \sin \left (d x + c\right )}{d \cos \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-(b^2*d*x*cos(d*x + c) - 2*a*b - (a^2 + b^2)*sin(d*x + c))/(d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sin{\left (c + d x \right )}\right )^{2} \sec ^{2}{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**2*(a+b*sin(d*x+c))**2,x)

[Out]

Integral((a + b*sin(c + d*x))**2*sec(c + d*x)**2, x)

________________________________________________________________________________________

Giac [A]  time = 1.11494, size = 85, normalized size = 1.73 \begin{align*} -\frac{{\left (d x + c\right )} b^{2} + \frac{2 \,{\left (a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 2 \, a b\right )}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-((d*x + c)*b^2 + 2*(a^2*tan(1/2*d*x + 1/2*c) + b^2*tan(1/2*d*x + 1/2*c) + 2*a*b)/(tan(1/2*d*x + 1/2*c)^2 - 1)
)/d